package academic.nantes.teamsync;

import academic.nantes.teamsync.DAO.TeamSyncProject;
import academic.nantes.teamsync.DAO.TeamSyncRisque;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class Risque extends Activity {

	private int risque;
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Intent thisIntent = getIntent();

		risque = thisIntent.getExtras().getInt("risque");
		
		TeamSyncRisque ri = TeamSyncProject.getInstance().getRisqueById(risque);				
		setContentView(R.layout.risque);

		TextView tvRisque = (TextView)findViewById(R.id.tvRisque);
		tvRisque.setText(ri.getLibelle());
		TextView tvImpact = (TextView)findViewById(R.id.tvImpact);
		tvImpact.setText(ri.getImpact());
		TextView tvDanger = (TextView)findViewById(R.id.tvDanger);
		tvDanger.setText(Integer.toString(ri.getCriticite()));
		TextView tvActPrev = (TextView)findViewById(R.id.tvActPrev);
		tvActPrev.setText(ri.getActionsPrev());
	}

}
